﻿using Anke.SHManage.MSSQLDAL.TJDAL;
using Microsoft.Reporting.WebForms;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Anke.SHManage.Web.Reports
{
    public partial class TJ_ZDTFXZHSGModeWebForm : System.Web.UI.Page
    {
        private string AlarmEventCoding;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitPage();
                this.ReportViewer1.LocalReport.EnableHyperlinks = true;
            }

        }

        private void InitPage()
        {
            AlarmEventCoding = Request.QueryString["AlarmEventCoding"];

            BindReportDataSource();
        }
        protected void BindReportDataSource()
        {

            this.ReportViewer1.LocalReport.DataSources.Clear();
            this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/TJ_ZDTFXZHSG.rdlc");
            TJDAL dalt = new TJDAL();

            //以下部分拼接成登记表
            DataTable dt1 = dalt.GetTJ_ZDTFXZHSG_Anchor120V5(AlarmEventCoding);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_ZDTFXZHSG_Anchor120V5", dt1));
            DataTable dt2 = dalt.GetTJ_ZDTFXZHSG_Attemper(AlarmEventCoding);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_ZDTFXZHSG_Attemper", dt2));
            DataTable dt3 = dalt.GetTJ_ZDTFXZHSG_Report(AlarmEventCoding);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_ZDTFXZHSG_Report", dt3));
            DataTable dt4 = dalt.GetTJ_ZDTFXZHSG_Station(AlarmEventCoding);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_ZDTFXZHSG_Station", dt4));
            DataTable dt5 = dalt.GetTJ_ZDTFXZHSG_Hospital(AlarmEventCoding);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_ZDTFXZHSG_Hospital", dt5));

            this.ReportViewer1.LocalReport.Refresh();
        }
    }
}